﻿<primitives:DialogBase x:Class="Neurotoxin.Godspeed.Shell.Views.Dialogs.LoginDialog"
                       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                       xmlns:primitives="clr-namespace:Neurotoxin.Godspeed.Shell.Primitives"
                       xmlns:lex="http://wpflocalizeextension.codeplex.com"
                       lex:LocalizeDictionary.DesignCulture="en-US"
                       lex:ResxLocalizationProvider.DefaultAssembly="Neurotoxin.Godspeed.Shell"
                       lex:ResxLocalizationProvider.DefaultDictionary="Resources"
                       Width="400" Title="{Binding Title}">
    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <TextBlock Grid.Row="0" Grid.ColumnSpan="2" Margin="5,0,0,5" Text="{Binding Message}" TextWrapping="Wrap" />

        <TextBlock Grid.Row="1" Grid.Column="0" Text="{lex:Loc Username}" Margin="5,0,0,5" VerticalAlignment="Center"/>
        <TextBox Grid.Row="1" Grid.Column="1" Margin="0,0,0,5" Text="{Binding Username, UpdateSourceTrigger=PropertyChanged}" x:Name="Username"/>

        <TextBlock Grid.Row="2" Grid.Column="0" Text="{lex:Loc Password}" Margin="5,0,0,5" VerticalAlignment="Center"/>
        <TextBox Grid.Row="2" Grid.Column="1" Margin="0,0,0,5" Text="{Binding Password, UpdateSourceTrigger=PropertyChanged}"/>
        
        <CheckBox Grid.Row="3" Grid.Column="1" Content="{lex:Loc RememberPassword}" Margin="0,0,0,10" IsChecked="{Binding RememberPassword}" Visibility="{Binding IsRememberPasswordEnabled, Converter={StaticResource BoolToVis}}"/>

        <StackPanel Grid.Row="5" Grid.ColumnSpan="2" HorizontalAlignment="Center" Orientation="Horizontal">
            <Button Content="{lex:LocText UseDefault}" Margin="5" MinWidth="75" Click="DefaultButtonClick" Visibility="{Binding IsUseDefaultEnabled, Converter={StaticResource BoolToVis}}"/>
            <Button Content="{lex:LocText Ok}" Margin="5" MinWidth="75" Click="OkButtonClick" IsEnabled="{Binding IsValid}"/>
            <Button Content="{lex:LocText Cancel}" Margin="5" MinWidth="75" Click="CancelButtonClick"/>
        </StackPanel>

    </Grid>
</primitives:DialogBase>